// Author: Ivan Kazmenko (gassa@mail.ru)
module solution;
import std.stdio;
import std.string;

string solve (string s)
{
	string res = null;
	for (int i = 1; i < s.length; i += 2)
	{
		if (s[i] == s[i - 1])
		{
			res ~= s[i];
		}
	}
	if (res is null)
	{
		res = "NONE";
	}
	return res;
}

void main ()
{
	string s;
	while ((s = readln.strip) != "")
	{
		writeln (solve (s));
	}
}
